﻿@using CodeCamp.Models.Sessions
@model EditSessionTags
<fieldset>
    @Html.Hidden("SessionId", Model.SessionId)
    <b>Update tags for this session:</b><br />
    @{
        var firstTag = true;
        foreach(var tag in Model.AllEventTags)
        {
            if (!firstTag)
            { <text>&nbsp;</text> }
            firstTag = false;
            if (Model.SessionTags.Tags.Exists(t => t.TagId == tag.Id))
            {
        <input type="checkbox" name="sessionTags"
            value="@tag.Id"
            checked = "checked"
        /> @tag.Name
            }
            else
            {
        <input type="checkbox" name="sessionTags"
            value="@tag.Id"
        /> @tag.Name
            }
        }
		<br/>
        <input type="submit" value="Update" />
    }
</fieldset>